package app.agent.scatchpad

import app.agent.scatchpad.ScratchPadLocator._
import app.server.ServicesResponse
import im.mange.jetboot.{Renderable, Html}
import Html._

//TODO: potentially this is shareable?
case class ScratchPadContentAgent() extends Renderable {
  private val holder = div(scratchPadContentAgent).classes("hidden")

  override def render = holder.render

  def onHide = holder.empty & holder.hide
  def onShowResponse(response: ServicesResponse) = holder.show & holder.fill(ScratchPadContentPresentation(response.services))
}